home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Addition / card_7737.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.1 KB  |  489 lines

  1. -- card: 7737 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 7635
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0001
  11. -- rect: left=256 top=229 right=320 bottom=352
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Smiley
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: 0001
  25. -- rect: left=251 top=87 right=180 bottom=351
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Frowney
  34.  
  35.  
  36. -- part 3 (button)
  37. -- low flags: 00
  38. -- high flags: 8003
  39. -- rect: left=354 top=102 right=139 bottom=468
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Next Problem
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   if field "Flag" = 0 then exit mouseUp
  51.   show button "Smiley"
  52.   show button "Frowney"
  53.   put empty into field "Comment"
  54.   put "  " into field "Addend1"
  55.   put "  " into field "Addend2"
  56.   put empty into field "Sum"
  57.   if field "Attempts" = second word of bkgnd field "Options" then
  58.     put field "Attempts" into attempts
  59.     put field "Correct" into correct
  60.     put field "Percent" into percent
  61.     put field "Name" into name
  62.     put third word of field "Options" into skill
  63.     put "O" into field "Attempts"
  64.     put "O" into field "Correct"
  65.     put "O" into field "Percent"
  66.     set the lockScreen to true
  67.     set the cursor to 4
  68.     go to first card of bkgnd "Users"
  69.     rotateData
  70.     put name into line 1 of field "name"
  71.     put the date into line 1 of field "Date"
  72.     put skill into line 1 of field "Skill"
  73.     put attempts into line 1 of field "Attempts"
  74.     put correct into line 1 of field "Correct"
  75.     put percent into line 1 of field "Percent"
  76.     pop card
  77.     exit mouseUp
  78.   end if
  79.   get the random of 800
  80.   add 99 to it
  81.   put it into field "Addend1"
  82.   put 9 into it
  83.   subtract third char of field "Addend1" from it
  84.   get the random of it
  85.   subtract 1 from it
  86.   put it into third char of field "Addend2"
  87.   put 9 into it
  88.   subtract second char of field "Addend1" from it
  89.   get the random of it
  90.   subtract 1 from it
  91.   put it into second char of field "Addend2"
  92.   put 8 into it
  93.   subtract first char of field "Addend1" from it
  94.   if it >0 then get the random of it else put 1 into it
  95.   put it into first char of field "Addend2"
  96.   put field "Addend1" into answer
  97.   add field "Addend2" to answer
  98.   put "   " into field "Sum"
  99.   put "0" into field "Flag"
  100.   put "?" into char 3 of field "Sum"
  101. end mouseUp
  102.  
  103. on rotateData
  104.   repeat with x = 11 down to 1
  105.     if line x of field "Name" is empty then next repeat
  106.     put x into nextLine
  107.     add 1 to nextLine
  108.     get line x of field "Name"
  109.     put it into line nextLine of field "Name"
  110.     get line x of field "Date"
  111.     put it into line nextLine of field "Date"
  112.     get line x of field "Skill"
  113.     put it into line nextLine of field "Skill"
  114.     get line x of field "Attempts"
  115.     put it into line nextLine of field "Attempts"
  116.     get line x of field "Correct"
  117.     put it into line nextLine of field "Correct"
  118.     get line x of field "Percent"
  119.     put it into line nextLine of field "Percent"
  120.   end repeat
  121. end rotateData
  122.  
  123.  
  124.  
  125.  
  126. -- part 4 (button)
  127. -- low flags: 00
  128. -- high flags: 8003
  129. -- rect: left=355 top=161 right=194 bottom=388
  130. -- title width / last selected line: 0
  131. -- icon id / first selected line: 0 / 0
  132. -- text alignment: 1
  133. -- font id: 0
  134. -- text size: 12
  135. -- style flags: 0
  136. -- line height: 16
  137. -- part name: 7
  138. ----- HyperTalk script -----
  139. on mouseUp
  140.   repeat with x=3 down to 1
  141.     if char x of field "Sum" is "?" then
  142.       put "7" into char x of field "Sum"
  143.       put x into it
  144.       subtract 1 from it
  145.       if  x>1 then put "?" into char it of field "Sum"
  146.       exit mouseUp
  147.     end if
  148.   end repeat
  149. end mouseUp
  150.  
  151.  
  152.  
  153. -- part 5 (button)
  154. -- low flags: 00
  155. -- high flags: 8003
  156. -- rect: left=395 top=161 right=194 bottom=427
  157. -- title width / last selected line: 0
  158. -- icon id / first selected line: 0 / 0
  159. -- text alignment: 1
  160. -- font id: 0
  161. -- text size: 12
  162. -- style flags: 0
  163. -- line height: 16
  164. -- part name: 8
  165. ----- HyperTalk script -----
  166. on mouseUp
  167.   repeat with x=3 down to 1
  168.     if char x of field "Sum" is "?" then
  169.       put "8" into char x of field "Sum"
  170.       put x into it
  171.       subtract 1 from it
  172.       if  x>1 then put "?" into char it of field "Sum"
  173.       exit mouseUp
  174.     end if
  175.   end repeat
  176. end mouseUp
  177.  
  178.  
  179.  
  180. -- part 6 (button)
  181. -- low flags: 00
  182. -- high flags: 8003
  183. -- rect: left=435 top=162 right=194 bottom=467
  184. -- title width / last selected line: 0
  185. -- icon id / first selected line: 0 / 0
  186. -- text alignment: 1
  187. -- font id: 0
  188. -- text size: 12
  189. -- style flags: 0
  190. -- line height: 16
  191. -- part name: 9
  192. ----- HyperTalk script -----
  193. on mouseUp
  194.   repeat with x=3 down to 1
  195.     if char x of field "Sum" is "?" then
  196.       put "9" into char x of field "Sum"
  197.       put x into it
  198.       subtract 1 from it
  199.       if  x>1 then put "?" into char it of field "Sum"
  200.       exit mouseUp
  201.     end if
  202.   end repeat
  203. end mouseUp
  204.  
  205.  
  206.  
  207. -- part 7 (button)
  208. -- low flags: 00
  209. -- high flags: 8003
  210. -- rect: left=356 top=201 right=233 bottom=389
  211. -- title width / last selected line: 0
  212. -- icon id / first selected line: 0 / 0
  213. -- text alignment: 1
  214. -- font id: 0
  215. -- text size: 12
  216. -- style flags: 0
  217. -- line height: 16
  218. -- part name: 4
  219. ----- HyperTalk script -----
  220. on mouseUp
  221.   repeat with x=3 down to 1
  222.     if char x of field "Sum" is "?" then
  223.       put "4" into char x of field "Sum"
  224.       put x into it
  225.       subtract 1 from it
  226.       if  x>1 then put "?" into char it of field "Sum"
  227.       exit mouseUp
  228.     end if
  229.   end repeat
  230. end mouseUp
  231.  
  232.  
  233.  
  234. -- part 8 (button)
  235. -- low flags: 00
  236. -- high flags: 8003
  237. -- rect: left=395 top=202 right=234 bottom=428
  238. -- title width / last selected line: 0
  239. -- icon id / first selected line: 0 / 0
  240. -- text alignment: 1
  241. -- font id: 0
  242. -- text size: 12
  243. -- style flags: 0
  244. -- line height: 16
  245. -- part name: 5
  246. ----- HyperTalk script -----
  247. on mouseUp
  248.   repeat with x=3 down to 1
  249.     if char x of field "Sum" is "?" then
  250.       put "5" into char x of field "Sum"
  251.       put x into it
  252.       subtract 1 from it
  253.       if  x>1 then put "?" into char it of field "Sum"
  254.       exit mouseUp
  255.     end if
  256.   end repeat
  257. end mouseUp
  258.  
  259.  
  260.  
  261. -- part 9 (button)
  262. -- low flags: 00
  263. -- high flags: 8003
  264. -- rect: left=435 top=201 right=233 bottom=466
  265. -- title width / last selected line: 0
  266. -- icon id / first selected line: 0 / 0
  267. -- text alignment: 1
  268. -- font id: 0
  269. -- text size: 12
  270. -- style flags: 0
  271. -- line height: 16
  272. -- part name: 6
  273. ----- HyperTalk script -----
  274. on mouseUp
  275.   repeat with x=3 down to 1
  276.     if char x of field "Sum" is "?" then
  277.       put "6" into char x of field "Sum"
  278.       put x into it
  279.       subtract 1 from it
  280.       if  x>1 then put "?" into char it of field "Sum"
  281.       exit mouseUp
  282.     end if
  283.   end repeat
  284. end mouseUp
  285.  
  286.  
  287.  
  288. -- part 10 (button)
  289. -- low flags: 00
  290. -- high flags: 8003
  291. -- rect: left=356 top=242 right=274 bottom=389
  292. -- title width / last selected line: 0
  293. -- icon id / first selected line: 0 / 0
  294. -- text alignment: 1
  295. -- font id: 0
  296. -- text size: 12
  297. -- style flags: 0
  298. -- line height: 16
  299. -- part name: 1
  300. ----- HyperTalk script -----
  301. on mouseUp
  302.   repeat with x=3 down to 1
  303.     if char x of field "Sum" is "?" then
  304.       put "1" into char x of field "Sum"
  305.       put x into it
  306.       subtract 1 from it
  307.       if  x>1 then put "?" into char it of field "Sum"
  308.       exit mouseUp
  309.     end if
  310.   end repeat
  311. end mouseUp
  312.  
  313.  
  314.  
  315. -- part 11 (button)
  316. -- low flags: 00
  317. -- high flags: 8003
  318. -- rect: left=395 top=241 right=273 bottom=428
  319. -- title width / last selected line: 0
  320. -- icon id / first selected line: 0 / 0
  321. -- text alignment: 1
  322. -- font id: 0
  323. -- text size: 12
  324. -- style flags: 0
  325. -- line height: 16
  326. -- part name: 2
  327. ----- HyperTalk script -----
  328. on mouseUp
  329.   repeat with x=3 down to 1
  330.     if char x of field "Sum" is "?" then
  331.       put "2" into char x of field "Sum"
  332.       put x into it
  333.       subtract 1 from it
  334.       if  x>1 then put "?" into char it of field "Sum"
  335.       exit mouseUp
  336.     end if
  337.   end repeat
  338. end mouseUp
  339.  
  340.  
  341.  
  342. -- part 12 (button)
  343. -- low flags: 00
  344. -- high flags: 8003
  345. -- rect: left=436 top=242 right=274 bottom=468
  346. -- title width / last selected line: 0
  347. -- icon id / first selected line: 0 / 0
  348. -- text alignment: 1
  349. -- font id: 0
  350. -- text size: 12
  351. -- style flags: 0
  352. -- line height: 16
  353. -- part name: 3
  354. ----- HyperTalk script -----
  355. on mouseUp
  356.   repeat with x=3 down to 1
  357.     if char x of field "Sum" is "?" then
  358.       put "3" into char x of field "Sum"
  359.       put x into it
  360.       subtract 1 from it
  361.       if  x>1 then put "?" into char it of field "Sum"
  362.       exit mouseUp
  363.     end if
  364.   end repeat
  365. end mouseUp
  366.  
  367.  
  368.  
  369. -- part 13 (button)
  370. -- low flags: 00
  371. -- high flags: 8003
  372. -- rect: left=356 top=281 right=313 bottom=408
  373. -- title width / last selected line: 0
  374. -- icon id / first selected line: 0 / 0
  375. -- text alignment: 1
  376. -- font id: 0
  377. -- text size: 12
  378. -- style flags: 0
  379. -- line height: 16
  380. -- part name: 0
  381. ----- HyperTalk script -----
  382. on mouseUp
  383.   repeat with x=3 down to 1
  384.     if char x of field "Sum" is "?" then
  385.       put "0" into char x of field "Sum"
  386.       put x into it
  387.       subtract 1 from it
  388.       if  x>1 then put "?" into char it of field "Sum"
  389.       exit mouseUp
  390.     end if
  391.   end repeat
  392. end mouseUp
  393.  
  394.  
  395.  
  396. -- part 14 (button)
  397. -- low flags: 00
  398. -- high flags: 8003
  399. -- rect: left=414 top=281 right=313 bottom=468
  400. -- title width / last selected line: 0
  401. -- icon id / first selected line: 0 / 0
  402. -- text alignment: 1
  403. -- font id: 0
  404. -- text size: 12
  405. -- style flags: 0
  406. -- line height: 16
  407. -- part name: Enter
  408. ----- HyperTalk script -----
  409. on mouseUp
  410.   global answer
  411.   if field "SUM" < 1 then exit mouseUp
  412.   if field "Flag" > 0 then exit mouseUp
  413.   put field "Addend1" into answer
  414.   add field "Addend2" to answer
  415.   add 1 to field "Attempts"
  416.   if field "Sum" = answer then
  417.     add 1 to field "Correct"
  418.     get field "Correct"
  419.     divide it by field "Attempts"
  420.     multiply it by 100
  421.     put round(it) into field "Percent"
  422.     celebrate
  423.   else
  424.     get field "Correct"
  425.     divide it by field "Attempts"
  426.     multiply it by 100
  427.     put round(it) into field "Percent"
  428.     nag
  429.   end if
  430. end mouseUp
  431.  
  432. on celebrate
  433.   put "Correct" into line 1 of field "Comment"
  434.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  435.   hide button "Smiley"
  436.   put "1" into field "Flag"
  437.   if first word of bkgnd field "Options" = "Y" then
  438.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  439.   end if
  440. end celebrate
  441.  
  442. on nag
  443.   global answer
  444.   put "WRONG!" into line 1 of field "Comment"
  445.   put "The answer is "& answer & "." into line 2 of field "Comment"
  446.   hide button "Frowney"
  447.   put "2" into field "Flag"
  448.   if first word of bkgnd field "Options" = "Y" then
  449.     play "boing" tempo 200 "gq c e a"
  450.   end if
  451. end nag
  452.  
  453.  
  454.  
  455. -- part contents for background part 2
  456. ----- text -----
  457. 2
  458.  
  459. -- part contents for background part 3
  460. ----- text -----
  461. 1
  462.  
  463. -- part contents for background part 4
  464. ----- text -----
  465. 50
  466.  
  467. -- part contents for background part 5
  468. ----- text -----
  469. 209
  470.  
  471. -- part contents for background part 6
  472. ----- text -----
  473. 520
  474.  
  475. -- part contents for background part 9
  476. ----- text -----
  477. 0
  478.  
  479. -- part contents for background part 10
  480. ----- text -----
  481. Y 10 6
  482.  
  483. -- part contents for background part 11
  484. ----- text -----
  485. larry
  486.  
  487. -- part contents for background part 7
  488. ----- text -----
  489.   ?